**********************************************************
************* Author: Rithika Kumar **********************
************* Goal: SET UP IHDS DATASET ******************
************* Goal: Create codebook for all datasets *****
**********************************************************

***********************************************
*Set Path to "JOP Replication files" folder  *                
***********************************************


*****************************************
*	Creating datasets from Raw IHDS 	*              
*****************************************

*** 1. IHDS - MAIN DID DATASET 

do "CODE/DATA/CODE/ihds_merge.do"
do "CODE/DATA/CODE/ihds_main_df.do"
  
use "DATA FILES TO SHARE/TEMP_FILES/main_ew_hh_df.dta", clear

keep mig_husb mig_status year mob_score_norm dec_score_norm pol_score_norm GR_hh_cash GR_hh_acname vill_id_num EW_Age EW_child EW_health  dil_dummy rel_hindu EW_edu GROUPS8 ASSETS5 FM1 DISTID w2_abshusband_dummy w1_abshusband_dummy did_sample hhuid_num STATEID GRlux_A GRcook_A GRchild_A GRmarr_A GR_hh_ac GR_hh_prop pol_immu_dummy   pol_disc_yes mob_rel mob_hc mob_shop mob_mandi NR11 NR9 NR8 NR6 NR10 NNR NR13A ID14 HQ1 FM1 PSUID NR9 NR8 NR11 NNR NR10 NR6 NR13A FM11 AN1  INCCROP INCANIMAL INCAG INCBUSINESS INCOTHER INCSALARY INCOME INCAGLAB NF1 RC1 NNR NPERSONS NADULTM NADULTF HHLITERATE  URBAN HHID HHSPLITID PERSONID HHID2005 HHSPLITID2005 PERSONID2005 log_inc rel_muslim sc obc st 


save "DATA FILES TO SHARE/main_ew_hh_df.dta", replace


**** APPENDIX FILES ******

**** 2. IHDS - PLACEBO DATASET 


** A. Male and Female Placebo Data 

do "CODE/DATA/CODE/ihds_placebo_df.do"


**** C. Matching Dataset

do "CODE/DATA/CODE/ihds_matching_village_ew_merge.do"

**** D. IHDS - INCOME MECHANISM

do "CODE/DATA/CODE/ihds_farm_work.do"

**** E. IHDS - WAGE AND SALARY 

do "CODE/DATA/CODE/ihds_wages.do"


***** Label and create codebook for all relevant datasets 

do "CODE/DATA/CODE/codebook.do"



